package com.ts.api.module.match.market.internal.executor.model;

import com.ts.api.module.channel.entity.ChannelRequest;
import com.ts.api.module.channel.entity.po.ChannelMarketPO;
import com.ts.api.module.channel.entity.po.ChannelUserFormFieldPO;
import com.ts.api.module.channel.entity.po.ChannelUserRegisterPO;
import lombok.Data;

import java.util.List;

/**
 *  渠道贷超执行结果
 *
 *  @author Pan
 */
@Data
public class MarketExecuteTask {

    /** 用户注册对象 */
    private ChannelUserRegisterPO channelUserRegisterPO;
    /** 用户表单字段 */
    private List<ChannelUserFormFieldPO> channelUserFormPO;
    /** 渠道请求对象 */
    private ChannelRequest channelRequest;
    /** 渠道贷超实体 */
    private ChannelMarketPO channelMarket;
    /** 超时限制 */
    private Integer httpTimeout;
    /** 请求id */
    private Long reqId;

    /**
     *  构建任务
     *
     *  @param  channelRequest   渠道请求对象
     *  @param  channelMarket    渠道贷超实体
     *  @param  httpTimeout      超时时长
     *  @return MarketExecuteTask
     */
    public static MarketExecuteTask ofTask(ChannelRequest channelRequest, ChannelMarketPO channelMarket, Integer httpTimeout) {
        MarketExecuteTask executeTask = new MarketExecuteTask();
        executeTask.setChannelRequest(channelRequest);
        executeTask.setChannelMarket(channelMarket);
        executeTask.setHttpTimeout(httpTimeout);
        return executeTask;
    }
}
